
<?php
if (isset($data['course_id']) && !empty($data['course_id'])) {
    $className=SkillConfig::course_name;
    $courseName = substrclasscourname($data['course_titile']);
    $authKey = getClaCourseInfo('Courses', $data['course_id']);
    $imagePath = getImagePathByClassCourse('Courses', $data['course_id']);
    $url = $this->createAbsoluteUrl('/courses-'.$data['course_id'].'/'.$data['course_seo_title']);
    $userDetails = getUserTypeByClassCourse('Courses', $data['course_id']);
    $totalQuery = MakeQuery::counttotalQuery($data['course_id'], SkillConfig::course_name);
    $returnUrl = 'Courses/Update';
    $imageName = (ClassImage::getCoursesPrimaryImage($data['course_id']) != '') ? getRequestbaseUrl() . getuploadFolderDir() . SkillConfig::getClassCourseImagePath($imagePath) . '240X180/' . ClassImage::getCoursesPrimaryImage($data['course_id']) : getWorkNoshopimage(SkillConfig::skill_learn_page);
} else {    
    $className=SkillConfig::class_name;
    $authKey = getClaCourseInfo('Classes', $data['classes_id']);
    $returnUrl = 'Classes/Update';
    $imagePath = getImagePathByClassCourse('Classes', $data['classes_id']);
    $userDetails = getUserTypeByClassCourse('Classes', $data['classes_id']);
    $courseName = substrclasscourname($data['class_titile']);
    $imagePath = getImagePathByClassCourse('Classes', $data['classes_id']);
    $totalQuery = MakeQuery::counttotalQuery($data['classes_id'], SkillConfig::class_name);
    $url = $this->createAbsoluteUrl('/workshop-'.$data['classes_id'].'/'.$data['class_seo_title']);
    $imageName = (ClassImage::getPrimaryImage($data['classes_id']) != '') ? getRequestbaseUrl() . getuploadFolderDir() . SkillConfig::getClassCourseImagePath($imagePath) . '240X180/' . ClassImage::getPrimaryImage($data['classes_id']) : getWorkNoshopimage(SkillConfig::skill_learn_page);
}
$indexes = $index + 1;
if (($indexes % 3) == 0) {
    echo '<div class="row">';
};
?>
<div class="col-lg-4 col-md-4 col-sm-4">
    <div class="thumbnail">
        <a href="<?php echo $url; ?>">  <?php echo '<img src="' . $imageName . '"  alt="' . $courseName . '">'; ?></a>
        <div class="clearfix"></div>
        <div class="caption">
            <div class="flow-over">
                <h3><?php echo $courseName; ?></h3>
                <p><small><?php echo $userDetails->first_name; ?></small></p>
            </div>
            <p>
                <a href="javascript:void(0)" class="teach-button pull-left"  id="<?php echo $authKey->auth_key; ?>"role="button" onclick="setAuthKey(this.id, '<?php echo $returnUrl; ?>')">Edit <?php echo $className;?> Details</a>

                <a href="<?php echo $url; ?>" class="teach-button pull-right" role="button">View  Details</a>
            </p>
            <div class="clearfix"></div>
            <p style="margin-top:12px;">
                <span class="pull-left">Queries : <?php echo $totalQuery; ?></span> 
                <span class="pull-right">Status : <?php echo ($data['status'] != 1) ? ' Inactive' : ' Active'; ?> </span>
            </p>
        </div>
        <div class="clearfix"></div>
    </div>
</div>
<?php
if (($indexes % 3) == 0) {
    echo'<div class="gap"></div></div><div class="clearfix"></div>';
};